﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data.SqlClient;
using System.Data;

namespace MockPrjTeam2.Common
{
    public class Ketnoi
    {
        public static SqlConnection conn;
        public static string sql = System.Configuration.ConfigurationManager.ConnectionStrings["AbServiceDirectoryConnectionString"].ConnectionString;
        public static SqlConnection connect()
        {
            if (conn == null)
                conn = new SqlConnection(sql);
            if (conn.State == ConnectionState.Closed)
            {
                conn.Open();
                return conn;
            }
            else
            {
                return conn;
            }
        }
    }
}